import { http } from '@/utils/http'
import type { newsDetail } from '@/types/editor'
import type { auditorDetail } from '@/types/index'
export const getNewsDetaiAPI = (id: number) => {
  return http<newsDetail>({
    method: 'GET',
    url: `/news/newsDetail?newsId=${id}`
  })
}
export const getCommentAPI = (data: any) => {
  return http<any>({
    url: `/news/getCommentNews?newsId=${data.newsId}&page=${data.page}&pageSize=${data.pageSize}`,
    method: 'GET'
  })
}
export const publishCommentAPI = (data: any) => {
  return http({
    url: '/news/commentNews',
    method: 'POST',
    data
  })
}
export const publishSubcommentAPI = (data: any) => {
  return http({
    url: '/news/subCommentNews',
    method: 'POST',
    data
  })
}
export const auditorDetailAPI = (account: string) => {
  return http<auditorDetail>({
    url: `/user/authorDetailInfo?account=${account}`,
    method: 'GET'
  })
}